
def get_a_file_data(filename, need_key):
    with open(filename, 'r') as f:
        row_list = f.read().splitlines()
    
    for row in row_list:
        key, value = row.split(':')
        if key == need_key:
            return eval(value)


if __name__ == "__main__":
    for i in range(10):
        res = get_a_file_data(f'../4_9_9_RandomOffsets/test{i}/result_data.log', 'average miss ddl')
        print(res)


